1. Field of the Invention
This invention relates to video signal processing, for example, processing in which compressed data representing two or more video signals are combined. Embodiments of the invention concern video signals compressed according to the known MPEG-2 standard, but the invention is not limited to such signals.
2. Description of the Prior Art
It is often desirable to mix, wipe or superimpose two or more video signals. For example, a so-called wipe effect might be used to transition between two different scenes in a television programme, or a so-called logo or other computer-generated signal such as a subtitle or a set of credits might need to be superimposed over a video image without otherwise disrupting the underlying image.
With analogue video signals, or even with uncompressed digital video signals, this operation is relatively straightforward. A key signal can be used to control the level of each of the constituent video signals (say, signals xe2x80x9cAxe2x80x9d and xe2x80x9cBxe2x80x9d) at each pixel position, with the two level-controlled signals then being added together. A basic relationship between the level of the key K signal, the levels A and B of the input pixels and the level of out output pixel at each pixel position might be:
Output pixel value=A(1xe2x88x92K)+BK
This process is carried out for each output pixel. So, if signal A is to be replaced in its entirety by signal B at a particular pixel position, the key signal would be 1 (otherwise expressed as 100%), and if there is to be a 50:50 mix of the two pixels the key value would be 0.5 or 50%.
The situation is much more difficult when either or both inputs is a compressed video stream. In a compressed video stream such as an MPEG-2 video stream, pixels are generally compressed as blocks known as macroblocks, so that it is not possible to derive the value of a particular pixel directly from the compressed video signal.
Compressed video signals are also often subject to an overall limit on the quantity of data that can be used to transmit or store the signal. While there can be some variation from picture to picture, or even from group-of-pictures (GOP) to (GOP), the time-averaged data rate is often constrained to the capacity of a transmission or storage channel. This allowable variation from picture to picture or GOP to GOP can mean that two signals to be combined can have the same nominal data rate but very different instantaneous data rates. So, when constructing a composite video signal from a group of video signals including one or more compressed signals, great care is needed to avoid a data overflow or underflow.
A third feature of compressed video signals relevant to this discussion is that they often make use of motion vectors to indicate blocks of temporally preceding or following pictures which are similar to a block of a current picture and so can cut down the amount of data needed to encode the current picture.
One way of handling these problems is to decompress the entire compressed input signals, carry out the mixing or similar process in the non-compressed domain and then recompress the resulting composite picture.
In systems such as the MPEG-2 system each generation of compression tends to reduce the quality of the resulting images. It is undesirable if the simple addition of logo or similar information causes a deterioration in the overall image quality of the pictures to which the logo information is added.
According to one aspect of the present invention, there is provided a video signal processor comprising a first input for receiving a compressed first video signal including parameters associated with the frames of the signal and relating to the compression,
a decoder for decoding the compressed first video signal whilst preserving the compression parameters in association with the frames,
a second input for receiving additional video information to be combined with the said first video information,
a combiner for combining the additional video information with the first video information to produce frames of combined information, and
an encoder for encoding the frames of combined video information, reusing the said preserved parameters of each frame for encoding a part of a frame of the combined information which does not contain additional video information and for encoding an edge region of another part of the frame, which another part contains additional information, to a higher picture quality than a region of said another part which is not the edge region.
Reusing the preserved compression parameters for the part or parts of the combined information which do not contain additional information (logo information) results in a smaller overall loss of image quality than from fully re-coding the whole frame of combined video information.
It has been found that edge regions of the logo information tend to be significant in terms of subjective picture quality. Encoding the edges with a higher quality than elsewhere within the logo improves the subjective picture quality.
In a preferred embodiment, the said edge region is encoded to a higher picture quality than the non-edge region of the logo information only if the first signal has a higher picture quality than the said non-edge region.
In a preferred embodiment, the encoder encodes the edge region with a predetermined value of the quantization parameter Q. In the embodiment , the edge region may be defined by a value of the key signal less than a threshold value.
In a preferred embodiment of the invention, quantisation parameters determined according to a predetermined algorithm are applied only to non-edge regions of the part of the frame containing logo information. This allows the quantisation of the logo to be determined separately from that of the picture regions containing only the first information. Thus the logo can be quantised to any desired quality. That quality could in principle be more or less than that of the first information. However it is currently envisaged that users will tend to choose lower quality for the additional information to preserve the quality of the first information.
In one embodiment, the quantisation for the additional information is chosen by the user and is for example a fixed value. The user chooses a value which provides the user with a desired quality of the additional information. An example of such additional information is a station identification logo or xe2x80x9cidentxe2x80x9d which is superimposed on main picture information and which may not require the same quality as the main picture information.
In another embodiment, where the region contains both first and additional information, then that region is quantised according to a weighted average of the fixed value of quantisation of the additional information and the preserved value of quantisation of the first information in the region.
The said regions are macroblocks as used in MPEG2 bitstreams for example.
In preferred embodiments of the invention, the processor includes a key signal generator for producing a key signal K defining the said regions of the picture containing the additional information. In one such embodiment, the said quantisation parameter Qw is determined according to a predetermined algorithm
QW=KAQF+(1xe2x88x92KA)QB
where KA is the average key value for a macroblock, QF is a predetermined fixed value of Q and QB is the preserved value of the quantisation parameter of the first video signal.
According to another aspect of the invention there is provided a method of processing a video signal processor comprising the steps of:
receiving a compressed first video signal including parameters associated with the frames of the signal and relating to the compression,
decoding the compressed first video signal whilst preserving the compression parameters in association with the frames,
receiving additional video information to be combined with the said first video information,
combining the additional video information with the first video information to produce frames of combined information, and
encoding the frames of combined video information, reusing the said preserved parameters of each frame for encoding a part of a frame of the combined information which does not contain additional video information and for encoding an edge region of another part of the frame, which another part contains additional information, to a higher picture quality than a region of said another part which is not the edge region.
According to a further aspect of the present invention, there is provided a computer program product providing computer executable instructions, which when loaded on to a programmable signal processor causes the processor to implement the method of said another aspect of the invention.
According to a yet further aspect of the present invention, there is provided computer program product providing computer executable instructions, which when loaded on to a programmable signal processor causes the processor to operate as the processor of said one aspect of the invention.